.class public Lcom/bitauto/autoeasy/selectcar/BrandListActivity;
.super Lcom/bitauto/autoeasy/BaseActivity;
.source "BrandListActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/selectcar/BrandListActivity$downLoadTask;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/bitauto/autoeasy/BaseActivity;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field private BrandList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Brand;",
            ">;"
        }
    .end annotation
.end field

.field private final TAG:Ljava/lang/String;

.field private flag:Z

.field private listView:Landroid/widget/ListView;

.field private suffix:I


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 21
    invoke-direct {p0}, Lcom/bitauto/autoeasy/BaseActivity;-><init>()V

    .line 28
    const-string v0, "BrandListActivity"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->TAG:Ljava/lang/String;

    .line 21
    return-void
.end method

.method static synthetic access$0(Lcom/bitauto/autoeasy/selectcar/BrandListActivity;)Z
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-boolean v0, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->flag:Z

    return v0
.end method


# virtual methods
.method public downLoadData()V
    .locals 4

    .prologue
    .line 42
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "bsid"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->suffix:I

    .line 43
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "http://m.bitauto.com/iphoneapi/v2/getbrand/?bsid="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v2, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->suffix:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;-><init>(Ljava/lang/String;)V

    .line 44
    .local v0, bParser:Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->Paser2Object()Ljava/util/ArrayList;

    move-result-object v1

    iput-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    .line 45
    return-void
.end method

.method public downLoadData2()V
    .locals 5

    .prologue
    .line 48
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->getIntent()Landroid/content/Intent;

    move-result-object v2

    const-string v3, "type"

    const/4 v4, 0x1

    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v1

    .line 49
    .local v1, index:I
    const-string v2, "BrandListActivity"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Type : "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 50
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "http://m.bitauto.com/iphoneapi/v2/searchbyprice/?type="

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;-><init>(Ljava/lang/String;)V

    .line 51
    .local v0, bParser:Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/BrandDetailParser;->Paser2Object()Ljava/util/ArrayList;

    move-result-object v2

    iput-object v2, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    .line 52
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    const/4 v3, 0x0

    .line 32
    invoke-super {p0, p1}, Lcom/bitauto/autoeasy/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 34
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "Price"

    invoke-virtual {v0, v1, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->flag:Z

    .line 35
    const v0, 0x7f03002a

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->setLayout(I)V

    .line 36
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->setTitleContent()V

    .line 37
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity$downLoadTask;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity$downLoadTask;-><init>(Lcom/bitauto/autoeasy/selectcar/BrandListActivity;)V

    const/4 v1, 0x1

    new-array v1, v1, [Ljava/lang/String;

    const-string v2, ""

    aput-object v2, v1, v3

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity$downLoadTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 39
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 3
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 74
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/bitauto/autoeasy/selectcar/BrandTypeActivity;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 75
    .local v0, intent:Landroid/content/Intent;
    const-string v2, "carid"

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->getId()I

    move-result v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 76
    const-string v2, "title"

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->getEName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 77
    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->startActivity(Landroid/content/Intent;)V

    .line 79
    return-void
.end method

.method public refreshView()V
    .locals 2

    .prologue
    .line 56
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-lez v1, :cond_0

    .line 57
    const v1, 0x102000a

    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ListView;

    iput-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->listView:Landroid/widget/ListView;

    .line 59
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;-><init>(Landroid/app/Activity;)V

    .line 60
    .local v0, adapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;->setList(Ljava/util/ArrayList;)V

    .line 61
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;->setListView(Landroid/widget/ListView;)V

    .line 63
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 64
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 68
    .end local v0           #adapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandListAdapter;
    :goto_0
    invoke-super {p0}, Lcom/bitauto/autoeasy/BaseActivity;->refreshView()V

    .line 69
    return-void

    .line 66
    :cond_0
    const v1, 0x7f030016

    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;->setContentView(I)V

    goto :goto_0
.end method
